package com.crm.controller.system;

import com.crm.dto.LogPagePramDto;
import com.crm.result.PageResult;
import com.crm.result.ResponseResult;
import com.crm.result.Result;
import com.crm.service.system.LogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/monitor/operlog")
@Slf4j
public class LogController {
    @Autowired
    private LogService logService;

    @GetMapping("/list")
    public Result queryPageLog(LogPagePramDto dto) {
        PageResult result = logService.queryPage(dto);
        return Result.commonSuccess(result);
    }

    @DeleteMapping("/{operId}")
    public ResponseResult delete(@PathVariable Integer operId) {
        logService.deleteLog(operId);
        return ResponseResult.success();
    }
}
